package decision_tree.metric;

import java.util.List;

public class AverageLogLikelihoodManager {
	private static AverageLogLikelihoodManager singleton = new AverageLogLikelihoodManager();
	public static AverageLogLikelihoodManager getInstance() {
		return singleton;
	}
	
	public double getEntropyFromProb(List<Double> probList) {
		double average_loglikelihood = 0;
		for(double prob : probList) {
			average_loglikelihood += Math.log(prob);
		}
		average_loglikelihood /= probList.size();
		return average_loglikelihood;
	}
}
